# SPDX-License-Identifier: GPL-2.0
#
# MPI multiprecision maths library (from gpg)
#
TOP=$(shell pwd)

SRC_DIR=$(TOP)
LIB_SRC += $(wildcard $(SRC_DIR)/mpi/*.c)
LIB_OBJ := $(patsubst %.c,%.o,$(LIB_SRC))
LIB_LINK := -I$(SRC_DIR)/mpi

TARGET:= mpi_test
CFLAG := -Wall -Wno-unused-but-set-variable -g

all: $(TARGET)

$(TARGET):$(LIB_OBJ) $(TARGET).c
	@gcc $(CFLAG) $(LIB_LINK) $^ -o $@

%.o : %.c
	$(CC) $(CFLAG) $(LIB_LINK) -c -fPIC $< -o $@

clean:
	rm -rf $(TARGET) $(LIB_OBJ)